/*
 * @Author: 康为 18037890117@163.com
 * @Date: 2023-07-06 13:21:00
 * @LastEditors: 康为 18037890117@163.com
 * @LastEditTime: 2023-07-06 14:11:58
 * @FilePath: /umi-max/src/framework/Card/CardHead/index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import * as React from 'react';
import { CardFrameProps } from '../index';
import classNames from 'classnames';
import styles from './index.less';

type CardHeadProps = Pick<
  CardFrameProps,
  'title' | 'hasPermission' | 'settings'
> & {
  cardHeadClassName?: string;
  renderCustom?: () => React.ReactNode;
};

function CardHead(props: CardHeadProps) {
  const { title, cardHeadClassName, renderCustom } = props;
  return (
    <div className={classNames(styles.cardHead, cardHeadClassName)}>
      <div
        className={
          title ? classNames(styles.title, styles.titleBorder) : styles.title
        }
      >
        {title}
      </div>
      <div className={styles.filter}>{renderCustom?.()}</div>
    </div>
  );
}

export default CardHead;
